﻿#ifndef COUNTDOWN_H
#define COUNTDOWN_H

#include <QTimer>
#include <QWidget>

class CountDown : public QWidget
{
    Q_OBJECT
public:
    explicit CountDown(QWidget *parent = nullptr);
    //开启倒计时定时器
    void showCountDown();
    //关闭倒计时
    void stopCountDown();
protected:
    void paintEvent(QPaintEvent *event);
signals:
    //时间不足5秒，发提示音
    void notMuchTime();
    //时间结束，强制玩家pass
    void timeout();
private:
    QPixmap m_clock;
    QPixmap m_number;
    QTimer* m_timer;
    int m_count;

};

#endif // COUNTDOWN_H
